﻿using Infrastructure.Events;
using Infrastructure.Storage;
using Ninject.Modules;

namespace Infrastructure.NinjectModules
{
    public class InfrastructureModule : NinjectModule
    {
        public override void Load()
        {
            Bind<IDomainEventHandlerFactory>().To<NinjectDomainEventHandlerFactory>();
            Bind<ICacheStorage>().To<MemoryCacheStorageAdapter>().InSingletonScope();
            Bind<ISessionStorage>().To<SessionStorageAdapter>().InRequestScope();
            Bind<IThreadStorage>().To<ThreadStorageAdapter>().InSingletonScope();
            Bind<IHttpContextStorage>().To<HttpContextStorageAdapter>().InSingletonScope();
        }
    }
}
